package com.mocker;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author Mocker
 * @Date 2017-02-08 下午5:04
 * @Version 1.0
 */
@WebFilter(filterName = "myWebFilter",urlPatterns = "/*")
public class MyWebFilter implements Filter{
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("MyWebFilter.init");
    }

    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("MyWebFilter.doFilter");
        filterChain.doFilter(servletRequest, servletResponse);
    }

    public void destroy() {
        System.out.println("MyWebFilter.destroy");
    }
}
